import {OffsetDateTime} from "java.time.OffsetDateTime";

@document({ name: "时间函数" })
@dslClass({ language: "java", code: "com.inspur.edp.rule.dsl.core.function.datetime.OffsetDateTimeUtils" })
export class OffsetDateTimeUtils{

   @document({ name: "天数差"})
   public static betweenDays(@document({name:"开始时间"}) start : OffsetDateTime , @document({name:"结束时间"}) end : OffsetDateTime) : long ;

   @document({ name: "增加年"})
   public static plusYears( @document({name:"日期"}) time : OffsetDateTime, @document({name:"年数"})  years : long) : OffsetDateTime ;

   @document({ name: "增加月"})
   public static plusMonths( @document({name:"日期"}) time : OffsetDateTime, @document({name:"月数"}) months : long) : OffsetDateTime ;

   @document({ name: "增加天"})
   public static plusDays( @document({name:"日期"}) time : OffsetDateTime, @document({name:"天数"}) days : long ) : OffsetDateTime ;

   @document({ name: "获取所在周第一天"})
   public static firstDayOfWeek(@document({name:"日期"}) time : OffsetDateTime ) : OffsetDateTime ;

   @document({ name: "获取所在周最后一天"})
   public static lastDayOfWeek(@document({name:"日期"}) time : OffsetDateTime ) : OffsetDateTime ;

   @document({ name: "获取所在月份第一天"})
   public static firstDayOfMonth( @document({name:"日期"}) time : OffsetDateTime ) : OffsetDateTime;

   @document({ name: "获取所在月份最后一天"})
   public static lastDayOfMonth( @document({name:"日期"}) time : OffsetDateTime ) : OffsetDateTime;

   @document({ name: "获取所在年度第一天"})
   public static firstDayOfYear( @document({name:"日期"})  time : OffsetDateTime ) : OffsetDateTime ;

   @document({ name: "获取所在年度最后一天"})
   public static lastDayOfYear( @document({name:"日期"})  time : OffsetDateTime ) : OffsetDateTime ;

   @document({ name: "获取当前日期"})
   public static now() : OffsetDateTime ;

   @document({ name: "日期比较"})
   public static  compare( @document({name:"日期1"}) time1 : OffsetDateTime , @dslParameter({name:"日期2"}) time2 : OffsetDateTime ) : int ;

   @document({ name: "格式化当前日期"})
   public static  formatNow( @document({name:"格式"}) format : string) : string ;

   @document({ name: "获取年份"})
   public static getYear( @document({name:"日期"}) time : OffsetDateTime ) : int ;

   @document({ name: "获取月份"})
   public static  getMonth( @document({name:"日期"}) time : OffsetDateTime) : int ;

   @document({ name: "获取年度"})
   public static getDayOfYear( @document({name:"日期"}) time : OffsetDateTime ) : int ;


}